package day09;

public class Student implements Cloneable{
		private String name;
		private int age;
								
		public Student(String name, int age) {
			super();
			this.name = name;
			this.age = age;
		}
		
		public int getAge() {
			return age;
		}
		public void setAge(int age) {
			this.age = age;
		}
		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}
	
		public Object clone()throws CloneNotSupportedException{
			return super.clone();
		}
		
		public boolean equals(Object obj){
			if(obj instanceof Student){
			Student s1=(Student)obj;		//强转为student.class
			if(this.name.equals(s1.name) && this.age==s1.age){
				return true;
				}	
			}
			return false;
		}
		
		public String toString(){
			return name+":"+age;
		}
}
